;; coordinate.scm - (c) rohan drape, 2003-2005

;; Co-ordinates for theta (phase) values of zero lie on the line (0,0)
;; to (inf,0), and increases counter-clockwise, so that the polar
;; co-ordinate (1 PI/2.0) is the rectangular co-ordinate (0,1).

(defineL (polar->rectangular {rho theta}) 
  {list (* rho (cos theta))
	(* rho (sin theta))})

(defineL (rectangular->polar {x y})
  {list (if (and (= x 0) (= y 0)) 0 (atan2 y x))
	(hypotenuse x y)})
